/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.raflik.queryxml.serializer.standard;

import java.util.prefs.Preferences;
import org.openide.util.NbPreferences;

/**
 *
 * @author raflik
 */
public class PrefUtil {
    public static String getStringSetting(Class clazz, String key, String defaultValue) {
        Preferences pref = NbPreferences.forModule(clazz);
        String userValue = pref.get(key, defaultValue);
        return userValue;
    }

    public static void setStringSetting(Class clazz, String key, String value) {
        Preferences pref = NbPreferences.forModule(clazz);
        pref.put(key, value);
    }

    public static Boolean getBooleanSetting(Class clazz, String key, boolean defaultValue) {
        Preferences pref = NbPreferences.forModule(clazz);
        Boolean userValue = pref.getBoolean(key, defaultValue);
        return userValue;
    }

    public static void setBooleanSetting(Class clazz, String key, boolean value) {
        Preferences pref = NbPreferences.forModule(clazz);
        pref.putBoolean(key, value);
    }

}
